package com.tee.live.api.controller;

import com.tee.live.user.interfaces.IUserRpc;
import com.tee.live.user.dto.UserDTO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

/**
 * @author tee
 * @date 2025/8/23
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @DubboReference
    private IUserRpc userRpc;

    @GetMapping("/getUserInfo")
    public UserDTO getUserInfo(@RequestParam Long userId) {
        return userRpc.getUserById(userId);
    }

    @PostMapping("/updateUserInfo")
    public boolean updateUserInfo(@RequestBody UserDTO userDTO) {
        return userRpc.updateUserInfo(userDTO);
    }

    @PostMapping("/insertUserInfo")
    public boolean insertUserInfo(@RequestBody UserDTO userDTO) {
        return userRpc.insertUserInfo(userDTO);
    }




}
